// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require("base");
	var router = require("../hash/pageRouter");
	var dialog = require("dialog");
	var validate = require("validate");
	var databind = require("databind");
	var css_detail_info = require("./cutLinesRecord.css");
	var constant = require("constant");
	var tools = require("tools");
	var financeId;
	var pageIndex = 1,
		pageSize = 10,
		totalPageCount = 1,
		totalRecordCount = 0; //分页初始化
	var init = function(page) {
		financeId = page.params.financeId
		inquireFinanceCutLinesPageList();
		initEvent();
	};
	var initEvent = function() {
		//若未登录，则返回登陆页面
		if (base.getData("sid") == null || base.getData("sid") == "" || base.getData("sid") == undefined) {
			top.location.href = "../login/login.html";
		}
	};

	//查询授信调整记录
	var inquireFinanceCutLinesPageList = function() {
		var oData = {
			pageIndex: pageIndex,
			pageSize: pageSize,
			totalPageCount: totalPageCount,
			totalRecordCount: totalRecordCount,
			financeId: financeId
		};
		tools.loadList("inquireFinanceCutLinesPageList.json", $("#cutLinesReocrdTable"), $("#cutLinesReocrdTpl"), oData, function(){
			$(".recordLook").mouseover(function(){
				$(this).parent().find(".reocrdRmak").css("display", "block");
			});
			
			$(".recordLook").mouseleave(function(){
				$(this).parent().find(".reocrdRmak").css("display", "none");
			});
			
			if($("#cutLinesReocrdTable tr").length == 1){
				$("#creditReocrdTable").html('<div>暂无调整记录！</div>');
			};	
		});
//		base.fnAjax({
//			action: "inquireFinanceCutLinesPageList.json",
//			oData: {
//				financeId: financeId
//			}, //传递参数
//			fnSuccess: function(data) { //成功回调
//				if (data.status == 200) {
//					var tpl = $("#cutLinesReocrdTpl").html();
//					var html = juicer(tpl, data);
//					$("#cutLinesReocrdTable").html(html);
//					
//					
//					
//				} else {
//					base.alert(3, data.message);
//				}
//			}
//		});
	}
	
	return {
		init: init
	};
});